<template>
    <div class="wrap">
        <a-select style="width: 100%;" :options="item.data" @change="onChange" :value="value"
            :placeholder="`${item.placeholder || '请选择'}`" :allowClear="true"></a-select>
    </div>
</template>
<script>
export default {
    namne: 'ZsSelect',
    props: {
        item: {
            type: Object,
        },
        otherData: {
            type: Object,
            default: () => { }
        },
        onFormChange: {
            type: Function,
            default: () => { }
        }
    },
    data() {
        return {
            value: '',
        }
    },
    mounted() {
    },
    methods: {
        onChange(e) {

            this.value = e;
            this.onFormChange({
                ...this.otherData,
                [this.item.dataIndex]: e,
            })
        },
    },
    watch: {
        menuId: {
            handler() {
            },
            immediate: true,
            deep: true,
        },
        otherData: {
            handler(nVal, oVal) {
                this.value = nVal[this.item.dataIndex]
            },
            deep: true,
            immediate: true,
        }
    }
}
</script>
<style lang="less" scoped>
.wrap {
    width: 100%;
}
</style>